using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VWASTAMM
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "AFS":
                case "TST":
                case "UBT":
                case "SXN":
                default:
                    #region=========
                    dwReturn["WAMANDANT"] = app.Mandant;
                    dwReturn["WAKUNDNR"] = "00000000";
                    dwReturn["WAWERK"] = "   ";
                    dwReturn["WAABT"] = "   ";
                    dwReturn["WAART"] = "                    ";
                    dwReturn["WAVAR"] = "  ";
                    dwReturn["WAAENZL"] = "1";
                    dwReturn["WAAENB"] = "        ";
                    dwReturn["WAAEND"] = "0";
                    dwReturn["WANEUB"] = "        ";
                    dwReturn["WANEUD"] = "0";
                    dwReturn["WABEZ"] = "                                        ";
                    dwReturn["WAMTART"] = "    ";
                    dwReturn["WAMU"] = " ";
                    dwReturn["WARKZ"] = "J";
                    dwReturn["WAFKZ"] = "J";
                    dwReturn["WAMUART"] = "                    ";
                    dwReturn["WAMUNR"] = "                    ";
                    dwReturn["WAHERLD"] = "   ";
                    dwReturn["WAFDDIM"] = "INC";
                    dwReturn["WAMURLOD"] = "00";
                    dwReturn["WAMUPROD"] = "00";
                    dwReturn["WAMUCTOD"] = " ";
                    dwReturn["WAMUDTRL"] = "0";
                    dwReturn["WAMUBIRL"] = "        ";
                    dwReturn["WAGASTA"] = "V";
                    dwReturn["WAMASTA"] = "V";
                    dwReturn["WAKESTA"] = "V";
                    dwReturn["WAROSTA"] = "N";
                    dwReturn["WARBSTA"] = "N";
                    dwReturn["WAFBSTA"] = "N";
                    dwReturn["WARPROF"] = "N";
                    dwReturn["WAFPROF"] = "N";
                    dwReturn["WARLSTA"] = "N";
                    dwReturn["WAFLSTA"] = "N";
                    dwReturn["WARSTAKZ"] = "A";
                    dwReturn["WAWAART"] = "GEW";
                    dwReturn["WARFERTKZ"] = "E";
                    dwReturn["WARKL"] = "    ";
                    dwReturn["WARMEHRB"] = " ";
                    dwReturn["WARVOLL"] = "P";
                    dwReturn["WARAUFM"] = "  ";
                    dwReturn["WATRAUFM"] = "  ";
                    dwReturn["WATRLG"] = "0";
                    dwReturn["WARSTDLG"] = "100000";
                    dwReturn["WARSTDGW"] = "100000";
                    dwReturn["WARABLOM"] = "          ";
                    dwReturn["WARMUNR"] = "               ";
                    dwReturn["WARBEM"] = "                                        ";
                    dwReturn["WATEXTE1"] = "          ";
                    dwReturn["WATEXTE2"] = "          ";
                    dwReturn["WATEXTE3"] = "          ";
                    dwReturn["WATEXTE4"] = "          ";
                    dwReturn["WAKRITI"] = "N";
                    dwReturn["WARGKZ1"] = " ";
                    dwReturn["WAGFKZ"] = "J";
                    dwReturn["WARAUFT"] = "        ";
                    dwReturn["WARAUFD"] = "0";
                    dwReturn["WARUNGLFM"] = " ";
                    dwReturn["WARUNGQM"] = " ";
                    dwReturn["WARUNBRT"] = " ";
                    dwReturn["WARUNFDK"] = " ";
                    dwReturn["WARUNFDS"] = " ";
                    dwReturn["WARWBRT"] = "0";
                    dwReturn["WARBRLST"] = "0";
                    dwReturn["WARBRTOL"] = "0";
                    dwReturn["WARGRQM"] = "0";
                    dwReturn["WARGRLFD"] = "0";
                    dwReturn["WARGWTOL"] = "0";
                    dwReturn["WARARTDICKE"] = "0000";
                    dwReturn["WARARTTOLP"] = "0000";
                    dwReturn["WARARTTOLM"] = "0000";
                    dwReturn["WARFDDIK"] = "0";
                    dwReturn["WARFDDIS"] = "0";
                    dwReturn["WABIND"] = "               ";
                    dwReturn["WARIPP"] = "0";
                    dwReturn["WASCHLICHTGR"] = "     ";
                    dwReturn["WASCHLICHTNR"] = "000000000000000";
                    dwReturn["WAEINZNR"] = "               ";
                    dwReturn["WATSDSCH"] = "0";
                    dwReturn["WASTTEIL"] = "J";
                    dwReturn["WAFSTAKZ"] = "A";
                    dwReturn["WAFFERTKZ"] = "Z";
                    dwReturn["WAAUSART"] = "FI  ";
                    dwReturn["WASTUEART"] = "   ";
                    dwReturn["WAVWART"] = "                    ";
                    dwReturn["WAVWVAR"] = "  ";
                    dwReturn["WAVARFR"] = "J";
                    dwReturn["WAFMEHRB"] = " ";
                    dwReturn["WAFVOLL"] = "P";
                    dwReturn["WAFAUFM"] = "  ";
                    dwReturn["WAFSTDLG"] = "100000";
                    dwReturn["WAFSTDGW"] = "100000";
                    dwReturn["WAFABLOM"] = "          ";
                    dwReturn["WAGVORL"] = "          ";
                    dwReturn["WAOVORL"] = "          ";
                    dwReturn["WAFRBST"] = "C ";
                    dwReturn["WALAMFR"] = "N";
                    dwReturn["WAFGKZ1"] = " ";
                    dwReturn["WAFGKZ2"] = " ";
                    dwReturn["WAFGKZ3"] = " ";
                    dwReturn["WASCHLKZ"] = " ";
                    dwReturn["WAFAUFT"] = "        ";
                    dwReturn["WAFAUFD"] = "0";
                    dwReturn["WAFKART"] = "          ";
                    dwReturn["WAKOLL"] = "     ";
                    dwReturn["WAFBEM"] = "                                        ";
                    dwReturn["WAFUNGLFM"] = " ";
                    dwReturn["WAFUNGQM"] = " ";
                    dwReturn["WAFUNBRT"] = " ";
                    dwReturn["WAFUNFDK"] = " ";
                    dwReturn["WAFUNFDS"] = " ";
                    dwReturn["WAFBRTU"] = "0";
                    dwReturn["WAFBRTUT"] = "0";
                    dwReturn["WAFBRTL"] = "0";
                    dwReturn["WAFBRTLT"] = "0";
                    dwReturn["WASCHNK"] = "0";
                    dwReturn["WALAEAEND"] = "0";
                    dwReturn["WARENDEM"] = "0";
                    dwReturn["WARENDEMNT"] = "0";
                    dwReturn["WAGWVERL"] = "0";
                    dwReturn["WAALKV"] = "00";
                    dwReturn["WAFGRQM"] = "0";
                    dwReturn["WAFGRLFD"] = "0";
                    dwReturn["WAFGWTOL"] = "0";
                    dwReturn["WAFARTDICKE"] = "0000";
                    dwReturn["WAFARTTOLP"] = "0000";
                    dwReturn["WAFARTTOLM"] = "0000";
                    dwReturn["WAFFDDIK"] = "0";
                    dwReturn["WAFFDDIS"] = "0";
                    dwReturn["WAUNI"] = " ";
                    dwReturn["WACOLORKZ"] = " ";
                    dwReturn["WAUNIGA"] = " ";
                    dwReturn["WAGEWICHT2"] = "0";
                    dwReturn["WAFVERF1"] = "   ";
                    dwReturn["WAFVERF2"] = "   ";
                    dwReturn["WAFVERF3"] = "   ";
                    dwReturn["WAFVERF4"] = "   ";
                    dwReturn["WAFZUSTAND1"] = "    ";
                    dwReturn["WAFZUSTAND2"] = "    ";
                    dwReturn["WAFZUSTAND3"] = "    ";
                    dwReturn["WAFZUSTAND4"] = "    ";
                    dwReturn["WAFVERFN1"] = "   ";
                    dwReturn["WAFVERFN2"] = "   ";
                    dwReturn["WAFVERFN3"] = "   ";
                    dwReturn["WAFVERFN4"] = "   ";
                    dwReturn["WAFFGRPN1"] = " ";
                    dwReturn["WAFFGRPN2"] = " ";
                    dwReturn["WAFFGRPN3"] = " ";
                    dwReturn["WAFFGRPN4"] = " ";
                    dwReturn["WAVNRKZ"] = " ";
                    dwReturn["WAZUSTKZ"] = " ";
                    dwReturn["WAUEKLOKZ"] = " ";
                    dwReturn["WAFSUBST"] = "               ";
                    dwReturn["WAMAXFA"] = "0";
                    dwReturn["WAAKZWG"] = "0";
                    dwReturn["WAFRESTF"] = "0";
                    dwReturn["WADRUCKBAR"] = " ";
                    dwReturn["WAVBRGQM"] = "0";
                    dwReturn["WALEDR"] = "0";
                    dwReturn["WADVERF1"] = "   ";
                    dwReturn["WADVERF2"] = "   ";
                    dwReturn["WADVERF3"] = "   ";
                    dwReturn["WADVERF4"] = "   ";
                    dwReturn["WADZUSTAND1"] = "    ";
                    dwReturn["WADZUSTAND2"] = "    ";
                    dwReturn["WADZUSTAND3"] = "    ";
                    dwReturn["WADZUSTAND4"] = "    ";
                    dwReturn["WADVERFN1"] = "   ";
                    dwReturn["WADVERFN2"] = "   ";
                    dwReturn["WADVERFN3"] = "   ";
                    dwReturn["WADVERFN4"] = "   ";
                    dwReturn["WADFGRPN1"] = " ";
                    dwReturn["WADFGRPN2"] = " ";
                    dwReturn["WADFGRPN3"] = " ";
                    dwReturn["WADFGRPN4"] = " ";
                    dwReturn["WADSUBST"] = "               ";
                    dwReturn["WADRESTF"] = "0";
                    dwReturn["WAFAKTOR"] = "0";
                    dwReturn["WABSUBST"] = "               ";
                    dwReturn["WAVORBWA"] = "   ";
                    dwReturn["WANACHBWA"] = "   ";
                    dwReturn["WAVORBFB"] = "   ";
                    dwReturn["WANACHBFB"] = "   ";
                    dwReturn["WAVORBDR"] = "   ";
                    dwReturn["WANACHBDR"] = "   ";
                    dwReturn["WAVORBAP"] = "   ";
                    dwReturn["WANACHBAP"] = "   ";
                    dwReturn["WAMVB"] = "   ";
                    dwReturn["WAMNB"] = "   ";
                    dwReturn["WACVB"] = "   ";
                    dwReturn["WACNB"] = "   ";
                    dwReturn["WABVB"] = "   ";
                    dwReturn["WABNB"] = "   ";
                    dwReturn["WASVB"] = "   ";
                    dwReturn["WASNB"] = "   ";
                    dwReturn["WASUBSTGR"] = "   ";
                    dwReturn["WAHANDICAP"] = "   ";
                    dwReturn["WAZUSCHAB"] = "0";
                    dwReturn["WALOSGRFB"] = "0";
                    dwReturn["WAQCCHECK"] = " ";
                    dwReturn["WADART"] = "                    ";
                    dwReturn["WADVAR"] = "  ";
                    dwReturn["WADSTDKZ"] = "J";
                    dwReturn["WADSACHB"] = "        ";
                    dwReturn["WASCHNKZ"] = " ";
                    dwReturn["WAPROGRP"] = "   ";
                    dwReturn["WAARTGRP"] = "1  ";
                    dwReturn["WAWBZEIT"] = "00";
                    dwReturn["WAMINBST"] = "0";
                    dwReturn["WAMAXBST"] = "0";
                    dwReturn["WAOPTMGR"] = "5000";
                    dwReturn["WAOPTMGF"] = "5000";
                    dwReturn["WARMINPMENG"] = "0";
                    dwReturn["WAFMINPMENG"] = "0";
                    dwReturn["WAUEBM"] = "M  ";
                    dwReturn["WAUEBG"] = "2";
                    dwReturn["WAUEBF"] = "000001000000";
                    dwReturn["WAMATPRF"] = " ";
                    dwReturn["WABRTPRF"] = " ";
                    dwReturn["WAGQMPRF"] = " ";
                    dwReturn["WASTKGP"] = " ";
                    dwReturn["WASCHLIP"] = " ";
                    dwReturn["WASCHLIA"] = " ";
                    dwReturn["WALPABR"] = "N";
                    dwReturn["WADISPZS"] = "N";
                    dwReturn["WADRPAR"] = "     ";
                    dwReturn["WAZUSTR"] = " ";
                    dwReturn["WAWDSUM"] = " ";
                    dwReturn["WASTSKZ"] = " ";
                    dwReturn["WASTSART"] = " ";
                    dwReturn["WASTSAUF"] = " ";
                    dwReturn["WASTSLG"] = " ";
                    dwReturn["WASTSDKZ"] = " ";
                    dwReturn["WAFILLER1"] = "          ";
                    dwReturn["WAVOLU"] = "0";
                    dwReturn["WAVOLAM"] = "  ";
                    dwReturn["WAVOLDIAM"] = "0";
                    dwReturn["WAVOLMTR"] = "0";
                    dwReturn["WAVOLAMVOL"] = "0";
                    dwReturn["WAANAB"] = "0";
                    dwReturn["WAALBIS"] = "0";
                    dwReturn["WAPLGRP"] = "  ";
                    dwReturn["WAPRODH"] = "                  ";
                    dwReturn["WAMATKL"] = "         ";
                    dwReturn["WAPMGRP"] = "    ";
                    dwReturn["WAPRFSCHL"] = "         ";
                    dwReturn["WAKAART"] = "                    ";
                    dwReturn["WAKAVAR"] = "  ";
                    dwReturn["WAKASTD"] = "J";
                    dwReturn["WAKAZGRP"] = "   ";
                    dwReturn["WAKAPRGRPN1"] = " ";
                    dwReturn["WAKAPRGRPN2"] = " ";
                    dwReturn["WAKAPRGRPN3"] = " ";
                    dwReturn["WAKAAGRA"] = "     ";
                    dwReturn["WAKAAGRP"] = "  ";
                    dwReturn["WAZWTWAHL"] = "0";
                    dwReturn["WAVERL"] = "0";
                    dwReturn["WAABR"] = "0";
                    dwReturn["WAABRTOL"] = "0";
                    dwReturn["WAKABRT"] = "0";
                    dwReturn["WARKABRTOL"] = "0";
                    dwReturn["WAFKABRTOL"] = "0";
                    dwReturn["WAMATKTO"] = "      ";
                    dwReturn["WAKTO1"] = "      ";
                    dwReturn["WAGV"] = "      ";
                    dwReturn["WAKBON"] = "0";
                    dwReturn["WAMGKMM"] = "        ";
                    dwReturn["WAMEZ"] = "0";
                    dwReturn["WAWAG"] = "0";
                    dwReturn["WABKLAS"] = "    ";
                    dwReturn["WABWPLAN"] = " ";
                    dwReturn["WAEKGRP"] = "   ";
                    dwReturn["WABSTME"] = "   ";
                    dwReturn["WAVABME"] = " ";
                    dwReturn["WAEKWSL"] = "    ";
                    dwReturn["WALIEFNR"] = "        ";
                    dwReturn["WAEG"] = "N";
                    dwReturn["WABON"] = "N";
                    dwReturn["WAKUNDE"] = "        ";
                    dwReturn["WALOHNW"] = "                    ";
                    dwReturn["WALOHNA"] = "                    ";
                    dwReturn["WASCHLIAUF"] = "0";
                    dwReturn["WAPFCODE"] = "     ";
                    dwReturn["WAAUFKZ"] = " ";
                    dwReturn["WAMRKM1"] = "    ";
                    dwReturn["WAMRKM2"] = "    ";
                    dwReturn["WAMRKM3"] = "    ";
                    dwReturn["WAMRKM4"] = "    ";
                    dwReturn["WAMRKM5"] = "    ";
                    dwReturn["WAESACHB"] = "        ";
                    dwReturn["WAESACHBKZ"] = "B";
                    dwReturn["WAFBGRLFM"] = "0";
                    dwReturn["WAPRUEFKZ"] = "N";
                    dwReturn["WAPRUEFBEN"] = "        ";
                    dwReturn["WAPRUEFDAT"] = "0";
                    dwReturn["WARAVGRP"] = "10  ";
                    dwReturn["WATAX"] = "RMB";
                    dwReturn["WAPARTBA"] = " ";
                    dwReturn["WAFDDIF"] = "0";
                    dwReturn["WAINSPCOR"] = "    ";
                    dwReturn["WAINSPGRP"] = "    ";
                    dwReturn["WAKENNFD"] = " ";
                    dwReturn["WAFILLER2"] = "                               ";

                    #endregion
                    break;
            }
        }
        public void SetUpNewRow(ref DataRow dwReturn,DataRow dwInput)
        { 
            dwReturn.ItemArray = dwInput.ItemArray;
        }
        public DataRow Convert2WASTAMM(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryWASTAMM(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                case "YCC":
                default:
                    #region=========
                    dwReturn["WAMANDANT"] = app.Mandant;
                    dwReturn["WAKUNDNR"] = "00000000";
                    dwReturn["WAWERK"] = "   ";
                    dwReturn["WAABT"] = "   ";
                    dwReturn["WAART"] = "                    ";
                    dwReturn["WAVAR"] = "  ";
                    dwReturn["WAAENZL"] = "1";
                    dwReturn["WAAENB"] = "        ";
                    dwReturn["WAAEND"] = "0";
                    dwReturn["WANEUB"] = "        ";
                    dwReturn["WANEUD"] = "0";
                    dwReturn["WABEZ"] = "                                        ";
                    dwReturn["WAMTART"] = "    ";
                    dwReturn["WAMU"] = " ";
                    dwReturn["WARKZ"] = "J";
                    dwReturn["WAFKZ"] = "J";
                    dwReturn["WAMUART"] = "                    ";
                    dwReturn["WAMUNR"] = "                    ";
                    dwReturn["WAHERLD"] = "   ";
                    dwReturn["WAFDDIM"] = "INC";
                    dwReturn["WAMURLOD"] = "00";
                    dwReturn["WAMUPROD"] = "00";
                    dwReturn["WAMUCTOD"] = " ";
                    dwReturn["WAMUDTRL"] = "0";
                    dwReturn["WAMUBIRL"] = "        ";
                    dwReturn["WAGASTA"] = "V";
                    dwReturn["WAMASTA"] = "V";
                    dwReturn["WAKESTA"] = "V";
                    dwReturn["WAROSTA"] = "N";
                    dwReturn["WARBSTA"] = "N";
                    dwReturn["WAFBSTA"] = "N";
                    dwReturn["WARPROF"] = "N";
                    dwReturn["WAFPROF"] = "N";
                    dwReturn["WARLSTA"] = "N";
                    dwReturn["WAFLSTA"] = "N";
                    dwReturn["WARSTAKZ"] = "A";
                    dwReturn["WAWAART"] = "GEW";
                    dwReturn["WARFERTKZ"] = "E";
                    dwReturn["WARKL"] = "    ";
                    dwReturn["WARMEHRB"] = " ";
                    dwReturn["WARVOLL"] = "P";
                    dwReturn["WARAUFM"] = "  ";
                    dwReturn["WATRAUFM"] = "  ";
                    dwReturn["WATRLG"] = "0";
                    dwReturn["WARSTDLG"] = "0";
                    dwReturn["WARSTDGW"] = "0";
                    dwReturn["WARABLOM"] = "          ";
                    dwReturn["WARMUNR"] = "               ";
                    dwReturn["WARBEM"] = "                                        ";
                    dwReturn["WATEXTE1"] = "          ";
                    dwReturn["WATEXTE2"] = "          ";
                    dwReturn["WATEXTE3"] = "          ";
                    dwReturn["WATEXTE4"] = "          ";
                    dwReturn["WAKRITI"] = "N";
                    dwReturn["WARGKZ1"] = " ";
                    dwReturn["WAGFKZ"] = "J";
                    dwReturn["WARAUFT"] = "        ";
                    dwReturn["WARAUFD"] = "0";
                    dwReturn["WARUNGLFM"] = " ";
                    dwReturn["WARUNGQM"] = " ";
                    dwReturn["WARUNBRT"] = " ";
                    dwReturn["WARUNFDK"] = " ";
                    dwReturn["WARUNFDS"] = " ";
                    dwReturn["WARWBRT"] = "0";
                    dwReturn["WARBRLST"] = "0";
                    dwReturn["WARBRTOL"] = "0";
                    dwReturn["WARGRQM"] = "99";
                    dwReturn["WARGRLFD"] = "0";
                    dwReturn["WARGWTOL"] = "0";
                    dwReturn["WARARTDICKE"] = "0000";
                    dwReturn["WARARTTOLP"] = "0000";
                    dwReturn["WARARTTOLM"] = "0000";
                    dwReturn["WARFDDIK"] = "0";
                    dwReturn["WARFDDIS"] = "0";
                    dwReturn["WABIND"] = "               ";
                    dwReturn["WARIPP"] = "0";
                    dwReturn["WASCHLICHTGR"] = "     ";
                    dwReturn["WASCHLICHTNR"] = "000000000000000";
                    dwReturn["WAEINZNR"] = "               ";
                    dwReturn["WATSDSCH"] = "0";
                    dwReturn["WASTTEIL"] = "J";
                    dwReturn["WAFSTAKZ"] = "A";
                    dwReturn["WAFFERTKZ"] = "Z";
                    dwReturn["WAAUSART"] = "FI  ";
                    dwReturn["WASTUEART"] = "   ";
                    dwReturn["WAVWART"] = "                    ";
                    dwReturn["WAVWVAR"] = "  ";
                    dwReturn["WAVARFR"] = "J";
                    dwReturn["WAFMEHRB"] = " ";
                    dwReturn["WAFVOLL"] = "P";
                    dwReturn["WAFAUFM"] = "  ";
                    dwReturn["WAFSTDLG"] = "0";
                    dwReturn["WAFSTDGW"] = "0";
                    dwReturn["WAFABLOM"] = "          ";
                    dwReturn["WAGVORL"] = "          ";
                    dwReturn["WAOVORL"] = "          ";
                    dwReturn["WAFRBST"] = "C ";
                    dwReturn["WALAMFR"] = "N";
                    dwReturn["WAFGKZ1"] = " ";
                    dwReturn["WAFGKZ2"] = " ";
                    dwReturn["WAFGKZ3"] = " ";
                    dwReturn["WASCHLKZ"] = " ";
                    dwReturn["WAFAUFT"] = "        ";
                    dwReturn["WAFAUFD"] = "0";
                    dwReturn["WAFKART"] = "          ";
                    dwReturn["WAKOLL"] = "     ";
                    dwReturn["WAFBEM"] = "                                        ";
                    dwReturn["WAFUNGLFM"] = " ";
                    dwReturn["WAFUNGQM"] = " ";
                    dwReturn["WAFUNBRT"] = " ";
                    dwReturn["WAFUNFDK"] = " ";
                    dwReturn["WAFUNFDS"] = " ";
                    dwReturn["WAFBRTU"] = "0";
                    dwReturn["WAFBRTUT"] = "0";
                    dwReturn["WAFBRTL"] = "0";
                    dwReturn["WAFBRTLT"] = "0";
                    dwReturn["WASCHNK"] = "0";
                    dwReturn["WALAEAEND"] = "0";
                    dwReturn["WARENDEM"] = "0";
                    dwReturn["WARENDEMNT"] = "0";
                    dwReturn["WAGWVERL"] = "0";
                    dwReturn["WAALKV"] = "00";
                    dwReturn["WAFGRQM"] = "0";
                    dwReturn["WAFGRLFD"] = "0";
                    dwReturn["WAFGWTOL"] = "0";
                    dwReturn["WAFARTDICKE"] = "0000";
                    dwReturn["WAFARTTOLP"] = "0000";
                    dwReturn["WAFARTTOLM"] = "0000";
                    dwReturn["WAFFDDIK"] = "0";
                    dwReturn["WAFFDDIS"] = "0";
                    dwReturn["WAUNI"] = " ";
                    dwReturn["WACOLORKZ"] = " ";
                    dwReturn["WAUNIGA"] = " ";
                    dwReturn["WAGEWICHT2"] = "0";
                    dwReturn["WAFVERF1"] = "   ";
                    dwReturn["WAFVERF2"] = "   ";
                    dwReturn["WAFVERF3"] = "   ";
                    dwReturn["WAFVERF4"] = "   ";
                    dwReturn["WAFZUSTAND1"] = "    ";
                    dwReturn["WAFZUSTAND2"] = "    ";
                    dwReturn["WAFZUSTAND3"] = "    ";
                    dwReturn["WAFZUSTAND4"] = "    ";
                    dwReturn["WAFVERFN1"] = "   ";
                    dwReturn["WAFVERFN2"] = "   ";
                    dwReturn["WAFVERFN3"] = "   ";
                    dwReturn["WAFVERFN4"] = "   ";
                    dwReturn["WAFFGRPN1"] = " ";
                    dwReturn["WAFFGRPN2"] = " ";
                    dwReturn["WAFFGRPN3"] = " ";
                    dwReturn["WAFFGRPN4"] = " ";
                    dwReturn["WAVNRKZ"] = " ";
                    dwReturn["WAZUSTKZ"] = " ";
                    dwReturn["WAUEKLOKZ"] = " ";
                    dwReturn["WAFSUBST"] = "               ";
                    dwReturn["WAMAXFA"] = "0";
                    dwReturn["WAAKZWG"] = "0";
                    dwReturn["WAFRESTF"] = "0";
                    dwReturn["WADRUCKBAR"] = " ";
                    dwReturn["WAVBRGQM"] = "0";
                    dwReturn["WALEDR"] = "0";
                    dwReturn["WADVERF1"] = "   ";
                    dwReturn["WADVERF2"] = "   ";
                    dwReturn["WADVERF3"] = "   ";
                    dwReturn["WADVERF4"] = "   ";
                    dwReturn["WADZUSTAND1"] = "    ";
                    dwReturn["WADZUSTAND2"] = "    ";
                    dwReturn["WADZUSTAND3"] = "    ";
                    dwReturn["WADZUSTAND4"] = "    ";
                    dwReturn["WADVERFN1"] = "   ";
                    dwReturn["WADVERFN2"] = "   ";
                    dwReturn["WADVERFN3"] = "   ";
                    dwReturn["WADVERFN4"] = "   ";
                    dwReturn["WADFGRPN1"] = " ";
                    dwReturn["WADFGRPN2"] = " ";
                    dwReturn["WADFGRPN3"] = " ";
                    dwReturn["WADFGRPN4"] = " ";
                    dwReturn["WADSUBST"] = "               ";
                    dwReturn["WADRESTF"] = "0";
                    dwReturn["WAFAKTOR"] = "0";
                    dwReturn["WABSUBST"] = "               ";
                    dwReturn["WAVORBWA"] = "   ";
                    dwReturn["WANACHBWA"] = "   ";
                    dwReturn["WAVORBFB"] = "   ";
                    dwReturn["WANACHBFB"] = "   ";
                    dwReturn["WAVORBDR"] = "   ";
                    dwReturn["WANACHBDR"] = "   ";
                    dwReturn["WAVORBAP"] = "   ";
                    dwReturn["WANACHBAP"] = "   ";
                    dwReturn["WAMVB"] = "   ";
                    dwReturn["WAMNB"] = "   ";
                    dwReturn["WACVB"] = "   ";
                    dwReturn["WACNB"] = "   ";
                    dwReturn["WABVB"] = "   ";
                    dwReturn["WABNB"] = "   ";
                    dwReturn["WASVB"] = "   ";
                    dwReturn["WASNB"] = "   ";
                    dwReturn["WASUBSTGR"] = "   ";
                    dwReturn["WAHANDICAP"] = "   ";
                    dwReturn["WAZUSCHAB"] = "0";
                    dwReturn["WALOSGRFB"] = "0";
                    dwReturn["WAQCCHECK"] = " ";
                    dwReturn["WADART"] = "                    ";
                    dwReturn["WADVAR"] = "  ";
                    dwReturn["WADSTDKZ"] = "J";
                    dwReturn["WADSACHB"] = "        ";
                    dwReturn["WASCHNKZ"] = " ";
                    dwReturn["WAPROGRP"] = "   ";
                    dwReturn["WAARTGRP"] = "1  ";
                    dwReturn["WAWBZEIT"] = "00";
                    dwReturn["WAMINBST"] = "0";
                    dwReturn["WAMAXBST"] = "0";
                    dwReturn["WAOPTMGR"] = "5000";
                    dwReturn["WAOPTMGF"] = "5000";
                    dwReturn["WARMINPMENG"] = "0";
                    dwReturn["WAFMINPMENG"] = "0";
                    dwReturn["WAUEBM"] = "M  ";
                    dwReturn["WAUEBG"] = "2";
                    dwReturn["WAUEBF"] = "000001000000";
                    dwReturn["WAMATPRF"] = " ";
                    dwReturn["WABRTPRF"] = " ";
                    dwReturn["WAGQMPRF"] = " ";
                    dwReturn["WASTKGP"] = " ";
                    dwReturn["WASCHLIP"] = " ";
                    dwReturn["WASCHLIA"] = " ";
                    dwReturn["WALPABR"] = "N";
                    dwReturn["WADISPZS"] = "N";
                    dwReturn["WADRPAR"] = "     ";
                    dwReturn["WAZUSTR"] = " ";
                    dwReturn["WAWDSUM"] = " ";
                    dwReturn["WASTSKZ"] = " ";
                    dwReturn["WASTSART"] = " ";
                    dwReturn["WASTSAUF"] = " ";
                    dwReturn["WASTSLG"] = " ";
                    dwReturn["WASTSDKZ"] = " ";
                    dwReturn["WAFILLER1"] = "          ";
                    dwReturn["WAVOLU"] = "0";
                    dwReturn["WAVOLAM"] = "  ";
                    dwReturn["WAVOLDIAM"] = "0";
                    dwReturn["WAVOLMTR"] = "0";
                    dwReturn["WAVOLAMVOL"] = "0";
                    dwReturn["WAANAB"] = "0";
                    dwReturn["WAALBIS"] = "0";
                    dwReturn["WAPLGRP"] = "  ";
                    dwReturn["WAPRODH"] = "                  ";
                    dwReturn["WAMATKL"] = "         ";
                    dwReturn["WAPMGRP"] = "    ";
                    dwReturn["WAPRFSCHL"] = "         ";
                    dwReturn["WAKAART"] = "                    ";
                    dwReturn["WAKAVAR"] = "  ";
                    dwReturn["WAKASTD"] = "J";
                    dwReturn["WAKAZGRP"] = "   ";
                    dwReturn["WAKAPRGRPN1"] = " ";
                    dwReturn["WAKAPRGRPN2"] = " ";
                    dwReturn["WAKAPRGRPN3"] = " ";
                    dwReturn["WAKAAGRA"] = "     ";
                    dwReturn["WAKAAGRP"] = "  ";
                    dwReturn["WAZWTWAHL"] = "0";
                    dwReturn["WAVERL"] = "0";
                    dwReturn["WAABR"] = "0";
                    dwReturn["WAABRTOL"] = "0";
                    dwReturn["WAKABRT"] = "0";
                    dwReturn["WARKABRTOL"] = "0";
                    dwReturn["WAFKABRTOL"] = "0";
                    dwReturn["WAMATKTO"] = "      ";
                    dwReturn["WAKTO1"] = "      ";
                    dwReturn["WAGV"] = "      ";
                    dwReturn["WAKBON"] = "0";
                    dwReturn["WAMGKMM"] = "        ";
                    dwReturn["WAMEZ"] = "0";
                    dwReturn["WAWAG"] = "0";
                    dwReturn["WABKLAS"] = "    ";
                    dwReturn["WABWPLAN"] = " ";
                    dwReturn["WAEKGRP"] = "   ";
                    dwReturn["WABSTME"] = "   ";
                    dwReturn["WAVABME"] = " ";
                    dwReturn["WAEKWSL"] = "    ";
                    dwReturn["WALIEFNR"] = "        ";
                    dwReturn["WAEG"] = "N";
                    dwReturn["WABON"] = "N";
                    dwReturn["WAKUNDE"] = "        ";
                    dwReturn["WALOHNW"] = "                    ";
                    dwReturn["WALOHNA"] = "                    ";
                    dwReturn["WASCHLIAUF"] = "0";
                    dwReturn["WAPFCODE"] = "     ";
                    dwReturn["WAAUFKZ"] = " ";
                    dwReturn["WAMRKM1"] = "    ";
                    dwReturn["WAMRKM2"] = "    ";
                    dwReturn["WAMRKM3"] = "    ";
                    dwReturn["WAMRKM4"] = "    ";
                    dwReturn["WAMRKM5"] = "    ";
                    dwReturn["WAESACHB"] = "        ";
                    dwReturn["WAESACHBKZ"] = "B";
                    dwReturn["WAFBGRLFM"] = "0";
                    dwReturn["WAPRUEFKZ"] = "N";
                    dwReturn["WAPRUEFBEN"] = "        ";
                    dwReturn["WAPRUEFDAT"] = "0";
                    dwReturn["WARAVGRP"] = "10  ";
                    dwReturn["WATAX"] = "RMB";
                    dwReturn["WAPARTBA"] = " ";
                    dwReturn["WAFDDIF"] = "0";
                    dwReturn["WAINSPCOR"] = "    ";
                    dwReturn["WAINSPGRP"] = "    ";
                    dwReturn["WAKENNFD"] = " ";
                    dwReturn["WAFILLER2"] = "                               ";

                    #endregion
                    break;
                case "JLT":
                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapWASTAMM(ref DataRow dwLocal, DataRow dwData, bool flgExist = false, bool IsUseCurrentWS05 = false)
        {
            //WAPROGRP WAARTGRP
            #region
            dwLocal["WABEZ"] = dwData["WABEZ"];
            dwLocal["WAPROGRP"] = dwData["WAPROGRP"];
            dwLocal["WAARTGRP"] = dwData["WAARTGRP"];
            dwLocal["WAUEBM"] = dwData["WAUEBM"];
            dwLocal["WARWBRT"] = dwData["WARWBRT"];
            dwLocal["WAFBRTL"] = dwData["WAFBRTL"];
            dwLocal["WAFBRTU"] = dwData["WAFBRTU"];
            dwLocal["WAMANDANT"] = Helper.Left(dwData["WAMANDANT"].ToString() + "  ", 2);
            dwLocal["WAART"] = Helper.Left(dwData["WAART"].ToString() + "                                         ", 20);
            dwLocal["WAVAR"] = Helper.Left(dwData["WAVAR"].ToString() + "  ", 2);
            dwLocal["WAVWART"] = Helper.Left(dwData["WAART"].ToString() + "                                         ", 20);
            dwLocal["WAVWVAR"] = Helper.Left(dwData["WAVAR"].ToString() + "  ", 2);
            dwLocal["WAKAART"] = Helper.Left(dwData["WAART"].ToString() + "                                         ", 20);
            dwLocal["WAKAVAR"] = Helper.Left(dwData["WAVAR"].ToString() + "  ", 2);
            dwLocal["WARABLOM"] = dwData["WARABLOM"].ToString();
            dwLocal["WADART"] = Helper.Left(dwData["WADART"].ToString() + "                                         ", 20);
            dwLocal["WADVAR"] = Helper.Left(dwData["WADVAR"].ToString() + "  ", 2);
            dwLocal["WASUBSTGR"] = Helper.Left(dwData["WAART"].ToString() + "                                         ", 3);
            dwLocal["WARBEM"] = Helper.Left(dwData["WARBEM"].ToString().Trim() + "                                         ", 40);
            dwLocal["WAAENB"] = dwData["WAAENB"];
            dwLocal["WAAEND"] = dwData["WAAEND"];

            dwLocal["WAFSTDLG"] = dwData["WARSTDLG"];
            dwLocal["WARSTDLG"] = dwData["WARSTDLG"];
            dwLocal["WAGFKZ"] = dwData["WAGFKZ"];
            dwLocal["WAFFERTKZ"] = dwData["WAFFERTKZ"];
            dwLocal["WAFRBST"] = dwData["WAFRBST"];

            dwLocal["WAALKV"] = dwData["WAALKV"];
            dwLocal["WAFGWTOL"] = dwData["WAFGWTOL"];
            dwLocal["WARFDDIK"] = dwData["WARFDDIK"];
            dwLocal["WARFDDIS"] = dwData["WARFDDIS"];
            dwLocal["WAFFDDIK"] = dwData["WAFFDDIK"];
            dwLocal["WAFFDDIS"] = dwData["WAFFDDIS"];
            dwLocal["WAFDDIM"] = dwData["WAFDDIM"];
            dwLocal["WARGRLFD"] = dwData["WARGRLFD"];
            dwLocal["WAFGRLFD"] = dwData["WAFGRLFD"];
            dwLocal["WARGWTOL"] = dwData["WARGWTOL"];
            dwLocal["WATSDSCH"] = dwData["WATSDSCH"];
            dwLocal["WAFGRQM"] = dwData["WAFGRQM"];
            dwLocal["WARGRQM"] = dwData["WARGRQM"];
            dwLocal["WAFSTDGW"] = dwData["WAFSTDGW"];
            dwLocal["WARSTDGW"] = dwData["WARSTDGW"];
            dwLocal["WAARTGRP"] = dwData["WAARTGRP"];
            dwLocal["WAPROGRP"] = dwData["WAPROGRP"];
            dwLocal["WARSTDLG"] = dwData["WARSTDLG"];
            dwLocal["WAFSTDLG"] = dwData["WAFSTDLG"];
            dwLocal["WABIND"] = Helper.Left(dwData["WABIND"].ToString() + "               ", 15);
            dwLocal["WAEINZNR"] = Helper.Left(dwData["WAEINZNR"].ToString() + "                ", 15);
            dwLocal["WALAEAEND"] = dwData["WALAEAEND"];
            dwLocal["WAGASTA"] = "V";
            dwLocal["WARSTAKZ"] = "A";
            #endregion
            if (dwData["WARFERTKZ"].ToString() != "E")
            {
                dwLocal["WARFERTKZ"] = dwData["WARFERTKZ"];
                dwLocal["WAGASTA"] = dwData["WAGASTA"];
                dwLocal["WAMASTA"] = dwData["WAMASTA"];
                dwLocal["WAKESTA"] = dwData["WAKESTA"];
                dwLocal["WAMATPRF"] = dwData["WAMATPRF"];
                dwLocal["WABRTPRF"] = dwData["WABRTPRF"];
                dwLocal["WASTKGP"] = dwData["WASTKGP"];
                dwLocal["WASCHLIP"] = dwData["WASCHLIP"];
                dwLocal["WASCHLIA"] = dwData["WASCHLIA"];
                dwLocal["WALIEFNR"] = dwData["WALIEFNR"];
                dwLocal["WAEG"] = dwData["WAEG"];
            }
            if (IsUseCurrentWS05
                && flgExist)
            {
            }
            else
            {
                #region=====else==========
                dwLocal["WABEZ"] = Helper.Left(dwData["WABEZ"].ToString().Trim() + "                                         ", 40);
                dwLocal["WANEUB"] = dwData["WANEUB"].ToString();
                dwLocal["WANEUD"] = dwData["WANEUD"].ToString();
                #endregion
            }
        }
        public void SaveWASTAMM(DataRow dwData, DataRow dwDispo)
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            bool IsUseCurrentWS05 = true;
            setResult = QueryWASTAMM(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }

            MapWASTAMM(ref dwLocal, dwData, flgExist, IsUseCurrentWS05);

            if (!flgExist)
            {
                InsertWASTAMM(dwLocal);
            }
            UpdateWASTAMM(dwLocal);
        }
        public void InsertWASTAMM(DataRow dwData, string ITXDBVERSION = "50.24")
        {

            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                case "AFS":
                case "TST":
                case "UBT":
                case "SXN":
                default:
                    or1.CommandText = "INSERT INTO WASTAMM(WAMANDANT, WAKUNDNR, WAWERK, WAABT, WAART, WAVAR, WAAENZL, WAAENB, WAAEND, WANEUB, WANEUD, WABEZ, WAMTART, WAMU, WARKZ, WAFKZ, WAMUART, WAMUNR, WAHERLD, WAFDDIM, WAMURLOD, WAMUPROD, WAMUCTOD, WAMUDTRL, WAMUBIRL, WAGASTA, WAMASTA, WAKESTA, WAROSTA, WARBSTA, WAFBSTA, WARPROF, WAFPROF, WARLSTA, WAFLSTA, WARSTAKZ, WAWAART, WARFERTKZ, WARKL, WARMEHRB, WARVOLL, WARAUFM, WATRAUFM, WATRLG, WARSTDLG, WARSTDGW, WARABLOM, WARMUNR, WARBEM, WATEXTE1, WATEXTE2, WATEXTE3, WATEXTE4, WAKRITI, WARGKZ1, WAGFKZ, WARAUFT, WARAUFD, WARUNGLFM, WARUNGQM, WARUNBRT, WARUNFDK, WARUNFDS, WARWBRT, WARBRLST, WARBRTOL, WARGRQM, WARGRLFD, WARGWTOL, WARARTDICKE, WARARTTOLP, WARARTTOLM, WARFDDIK, WARFDDIS, WABIND, WARIPP, WASCHLICHTGR, WASCHLICHTNR, WAEINZNR, WATSDSCH, WASTTEIL, WAFSTAKZ, WAFFERTKZ, WAAUSART, WASTUEART, WAVWART, WAVWVAR, WAVARFR, WAFMEHRB, WAFVOLL, WAFAUFM, WAFSTDLG, WAFSTDGW, WAFABLOM, WAGVORL, WAOVORL, WAFRBST, WALAMFR, WAFGKZ1, WAFGKZ2, WAFGKZ3, WASCHLKZ, WAFAUFT, WAFAUFD, WAFKART, WAKOLL, WAFBEM, WAFUNGLFM, WAFUNGQM, WAFUNBRT, WAFUNFDK, WAFUNFDS, WAFBRTU, WAFBRTUT, WAFBRTL, WAFBRTLT, WASCHNK, WALAEAEND, WARENDEM, WARENDEMNT, WAGWVERL, WAALKV, WAFGRQM, WAFGRLFD, WAFGWTOL, WAFARTDICKE, WAFARTTOLP, WAFARTTOLM, WAFFDDIK, WAFFDDIS, WAUNI, WACOLORKZ, WAUNIGA, WAGEWICHT2, WAFVERF1, WAFVERF2, WAFVERF3, WAFVERF4, WAFZUSTAND1, WAFZUSTAND2, WAFZUSTAND3, WAFZUSTAND4, WAFVERFN1, WAFVERFN2, WAFVERFN3, WAFVERFN4, WAFFGRPN1, WAFFGRPN2, WAFFGRPN3, WAFFGRPN4, WAVNRKZ, WAZUSTKZ, WAUEKLOKZ, WAFSUBST, WAMAXFA, WAAKZWG, WAFRESTF, WADRUCKBAR, WAVBRGQM, WALEDR, WADVERF1, WADVERF2, WADVERF3, WADVERF4, WADZUSTAND1, WADZUSTAND2, WADZUSTAND3, WADZUSTAND4, WADVERFN1, WADVERFN2, WADVERFN3, WADVERFN4, WADFGRPN1, WADFGRPN2, WADFGRPN3, WADFGRPN4, WADSUBST, WADRESTF, WAFAKTOR, WABSUBST, WAVORBWA, WANACHBWA, WAVORBFB, WANACHBFB, WAVORBDR, WANACHBDR, WAVORBAP, WANACHBAP, WAMVB, WAMNB, WACVB, WACNB, WABVB, WABNB, WASVB, WASNB, WASUBSTGR, WAHANDICAP, WAZUSCHAB, WALOSGRFB, WAQCCHECK, WADART, WADVAR, WADSTDKZ, WADSACHB, WASCHNKZ, WAPROGRP, WAARTGRP, WAWBZEIT, WAMINBST, WAMAXBST, WAOPTMGR, WAOPTMGF, WARMINPMENG, WAFMINPMENG, WAUEBM, WAUEBG, WAUEBF, WAMATPRF, WABRTPRF, WAGQMPRF, WASTKGP, WASCHLIP, WASCHLIA, WALPABR, WADISPZS, WADRPAR, WAZUSTR, WAWDSUM, WASTSKZ, WASTSART, WASTSAUF, WASTSLG, WASTSDKZ, WAFILLER1, WAVOLU, WAVOLAM, WAVOLDIAM, WAVOLMTR, WAVOLAMVOL, WAANAB, WAALBIS, WAPLGRP, WAPRODH, WAMATKL, WAPMGRP, WAPRFSCHL, WAKAART, WAKAVAR, WAKASTD, WAKAZGRP, WAKAPRGRPN1, WAKAPRGRPN2, WAKAPRGRPN3, WAKAAGRA, WAKAAGRP, WAZWTWAHL, WAVERL, WAABR, WAABRTOL, WAKABRT, WARKABRTOL, WAFKABRTOL, WAMATKTO, WAKTO1, WAGV, WAKBON, WAMGKMM, WAMEZ, WAWAG, WABKLAS, WABWPLAN, WAEKGRP, WABSTME, WAVABME, WAEKWSL, WALIEFNR, WAEG, WABON, WAKUNDE, WALOHNW, WALOHNA, WASCHLIAUF, WAPFCODE, WAAUFKZ, WAMRKM1, WAMRKM2, WAMRKM3, WAMRKM4, WAMRKM5, WAESACHB, WAESACHBKZ, WAFBGRLFM, WAPRUEFKZ, WAPRUEFBEN, WAPRUEFDAT, WARAVGRP, WATAX, WAPARTBA, WAFDDIF, WAINSPCOR, WAINSPGRP, WAKENNFD, WAFILLER2)"
                      + "VALUES(:WAMANDANT:,:WAKUNDNR:,:WAWERK:,:WAABT:,:WAART:,:WAVAR:,:WAAENZL:,:WAAENB:,:WAAEND:,:WANEUB:,:WANEUD:,:WABEZ:,:WAMTART:,:WAMU:,:WARKZ:,:WAFKZ:,:WAMUART:,:WAMUNR:,:WAHERLD:,:WAFDDIM:,:WAMURLOD:,:WAMUPROD:,:WAMUCTOD:,:WAMUDTRL:,:WAMUBIRL:,:WAGASTA:,:WAMASTA:,:WAKESTA:,:WAROSTA:,:WARBSTA:,:WAFBSTA:,:WARPROF:,:WAFPROF:,:WARLSTA:,:WAFLSTA:,:WARSTAKZ:,:WAWAART:,:WARFERTKZ:,:WARKL:,:WARMEHRB:,:WARVOLL:,:WARAUFM:,:WATRAUFM:,:WATRLG:,:WARSTDLG:,:WARSTDGW:,:WARABLOM:,:WARMUNR:,:WARBEM:,:WATEXTE1:,:WATEXTE2:,:WATEXTE3:,:WATEXTE4:,:WAKRITI:,:WARGKZ1:,:WAGFKZ:,:WARAUFT:,:WARAUFD:,:WARUNGLFM:,:WARUNGQM:,:WARUNBRT:,:WARUNFDK:,:WARUNFDS:,:WARWBRT:,:WARBRLST:,:WARBRTOL:,:WARGRQM:,:WARGRLFD:,:WARGWTOL:,:WARARTDICKE:,:WARARTTOLP:,:WARARTTOLM:,:WARFDDIK:,:WARFDDIS:,:WABIND:,:WARIPP:,:WASCHLICHTGR:,:WASCHLICHTNR:,:WAEINZNR:,:WATSDSCH:,:WASTTEIL:,:WAFSTAKZ:,:WA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RKM1:,:WAMRKM2:,:WAMRKM3:,:WAMRKM4:,:WAMRKM5:,:WAESACHB:,:WAESACHBKZ:,:WAFBGRLFM:,:WAPRUEFKZ:,:WAPRUEFBEN:,:WAPRUEFDAT:,:WARAVGRP:,:WATAX:,:WAPARTBA:,:WAFDDIF:,:WAINSPCOR:,:WAINSPGRP:,:WAKENNFD:,:WAFILLER2:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    break;
                case "JLT":
                    or1.CommandText = "INSERT INTO WASTAMM(WAMANDANT, WAKUNDNR, WAWERK, WAABT, WAART, WAVAR, WAAENZL, WAAENB, WAAEND, WANEUB, WANEUD, WABEZ, WAMTART, WAMU, WARKZ, WAFKZ, WAMUART, WAMUNR, WAHERLD, WAFDDIM, WAMURLOD, WAMUPROD, WAMUCTOD, WAMUDTRL, WAMUBIRL, WAGASTA, WAMASTA, WAKESTA, WAROSTA, WARBSTA, WAFBSTA, WARPROF, WAFPROF, WARLSTA, WAFLSTA, WARSTAKZ, WAWAART, WARFERTKZ, WARKL, WARMEHRB, WARVOLL, WARAUFM, WATRAUFM, WATRLG, WARSTDLG, WARSTDGW, WARABLOM, WARMUNR, WARBEM, WATEXTE1, WATEXTE2, WATEXTE3, WATEXTE4, WAKRITI, WARGKZ1, WAGFKZ, WARAUFT, WARAUFD, WARUNGLFM, WARUNGQM, WARUNBRT, WARUNFDK, WARUNFDS, WARWBRT, WARBRLST, WARBRTOL, WARGRQM, WARGRLFD, WARGWTOL, WARARTDICKE, WARARTTOLP, WARARTTOLM, WARFDDIK, WARFDDIS, WABIND, WARIPP, WASCHLICHTGR, WASCHLICHTNR, WAEINZNR, WATSDSCH, WASTTEIL, WAFSTAKZ, WAFFERTKZ, WAAUSART, WASTUEART, WAVWART, WAVWVAR, WAVARFR, WAFMEHRB, WAFVOLL, WAFAUFM, WAFSTDLG, WAFSTDGW, WAFABLOM, WAGVORL, WAOVORL, WAFRBST, WALAMFR, WAFGKZ1, WAFGKZ2, WAFGKZ3, WASCHLKZ, WAFAUFT, WAFAUFD, WAFKART, WAKOLL, WAFBEM, WAFUNGLFM, WAFUNGQM, WAFUNBRT, WAFUNFDK, WAFUNFDS, WAFBRTU, WAFBRTUT, WAFBRTL, WAFBRTLT, WASCHNK, WALAEAEND, WARENDEM, WARENDEMNT, WAGWVERL, WAALKV, WAFGRQM, WAFGRLFD, WAFGWTOL, WAFARTDICKE, WAFARTTOLP, WAFARTTOLM, WAFFDDIK, WAFFDDIS, WAUNI, WACOLORKZ, WAUNIGA, WAGEWICHT2, WAFVERF1, WAFVERF2, WAFVERF3, WAFVERF4, WAFZUSTAND1, WAFZUSTAND2, WAFZUSTAND3, WAFZUSTAND4, WAFVERFN1, WAFVERFN2, WAFVERFN3, WAFVERFN4, WAFFGRPN1, WAFFGRPN2, WAFFGRPN3, WAFFGRPN4, WAVNRKZ, WAZUSTKZ, WAUEKLOKZ, WAFSUBST, WAMAXFA, WAAKZWG, WAFRESTF, WADRUCKBAR, WAVBRGQM, WALEDR, WADVERF1, WADVERF2, WADVERF3, WADVERF4, WADZUSTAND1, WADZUSTAND2, WADZUSTAND3, WADZUSTAND4, WADVERFN1, WADVERFN2, WADVERFN3, WADVERFN4, WADFGRPN1, WADFGRPN2, WADFGRPN3, WADFGRPN4, WADSUBST, WADRESTF, WAFAKTOR, WABSUBST, WAVORBWA, WANACHBWA, WAVORBFB, WANACHBFB, WAVORBDR, WANACHBDR, WAVORBAP, WANACHBAP, WAMVB, WAMNB, WACVB, WACNB, WABVB, WABNB, WASVB, WASNB, WASUBSTGR, WAHANDICAP, WAZUSCHAB, WALOSGRFB, WAQCCHECK, WADART, WADVAR, WADSTDKZ, WADSACHB, WASCHNKZ, WAPROGRP, WAARTGRP, WAWBZEIT, WAMINBST, WAMAXBST, WAOPTMGR, WAOPTMGF, WARMINPMENG, WAFMINPMENG, WAUEBM, WAUEBG, WAUEBF, WAMATPRF, WABRTPRF, WAGQMPRF, WASTKGP, WASCHLIP, WASCHLIA, WALPABR, WADISPZS, WADRPAR, WAZUSTR, WAWDSUM, WASTSKZ, WASTSART, WASTSAUF, WASTSLG, WASTSDKZ, WAFILLER1, WAVOLU, WAVOLAM, WAVOLDIAM, WAVOLMTR, WAVOLAMVOL, WAANAB, WAALBIS, WAPLGRP, WAPRODH, WAMATKL, WAPMGRP, WAPRFSCHL, WAKAART, WAKAVAR, WAKASTD, WAKAZGRP, WAKAPRGRPN1, WAKAPRGRPN2, WAKAPRGRPN3, WAKAAGRA, WAKAAGRP, WAZWTWAHL, WAVERL, WAABR, WAABRTOL, WAKABRT, WARKABRTOL, WAFKABRTOL, WAMATKTO, WAKTO1, WAGV, WAKBON, WAMGKMM, WAMEZ, WAWAG, WABKLAS, WABWPLAN, WAEKGRP, WABSTME, WAVABME, WAEKWSL, WALIEFNR, WAEG, WABON, WAKUNDE, WALOHNW, WALOHNA, WASCHLIAUF, WAPFCODE, WAAUFKZ, WAMRKM1, WAMRKM2, WAMRKM3, WAMRKM4, WAMRKM5, WAESACHB, WAESACHBKZ, WAFBGRLFM, WAPRUEFKZ, WAPRUEFBEN, WAPRUEFDAT, WARAVGRP, WATAX, WAPARTBA, WAFDDIF, WAINSPCOR, WAINSPGRP, WAKENNFD, WAFILLER2)"
                        + " VALUES (:WAMANDANT:, '00000000', '   ', '   ',:WAART:, '  ', 1, :WAVAR:, 20140107, :WANEUB:, :WANEUD:, '01                                      ', '    ', ' ', 'J', 'J', '                    ', '                    ', '   ', 'INC', '00', '00', ' ', 0, '        ', 'V', 'V', 'V', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'A', 'GEW', 'E', '    ', ' ', 'P', '  ', '  ', 0, 130000, 20410, 'F99999    ', '               ', '                                        ', '          ', '          ', '          ', '          ', 'N', ' ', 'J', '        ', 0, ' ', ' ', ' ', ' ', ' ', 1570, 0, 0, 100, 157, 200, '0000', '0000', '0000', 11800, 7700, 'J3-2014        ', 0, '     ', '000000000000000', 'J3-2014        ', 3941, 'J', 'A', 'E', 'FI  ', '   ',:WAART, '  ', 'J', ' ', 'P', '  ', 200000, 3140, '          ', '          ', '          ', 'C ', 'N', ' ', ' ', ' ', ' ', '        ', 0, '          ', '     ', '                                        ', ' ', ' ', ' ', ' ', ' ', 1460, 0, 1460, 0, 0, 5, 0, 0, 0, '00', 108, 157, 0, '0000', '0000', '0000', 12700, 7800, ' ', ' ', ' ', 0, '   ', '   ', '   ', '   ', '    ', '    ', '    ', '    ', '   ', '   ', '   ', '   ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '               ', 0, 0, 0, ' ', 0, 0, '   ', '   ', '   ', '   ', '    ', '    ', '    ', '    ', '   ', '   ', '   ', '   ', ' ', ' ', ' ', ' ', '               ', 0, 0, '               ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', 'J3-', '   ', 0, 0, ' ', :WAART, '  ', 'J', '        ', ' ', 'MS ', '12 ', '00', 0, 0, 5000, 5000, 0, 0, 'M  ', '2', '000001000000', ' ', ' ', ' ', ' ', ' ', ' ', 'N', 'N', '     ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '          ', 0, '  ', 0, 0, 0, 0, 0, '  ', '                  ', '         ', '    ', '         ', :WAART, '  ', 'J', 'GGG', ' ', ' ', ' ', '     ', '  ', 80, 50, 0, '0', 0, 0, 0, '      ', '      ', '      ', 0, '        ', 0, 0, '    ', ' ', '   ', '   ', ' ', '    ', '        ', 'N', 'N', '        ', '                    ', '                    ', 0, '     ', ' ', '    ', '    ', '    ', '    ', '    ', '        ', 'B', 0, 'N', '        ', 0, '10  ', 'RMB', ' ', 25400, '    ', '    ', ' ', '                               ')";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case "DST":
                    or1.CommandText = "INSERT INTO WASTAMM(WAMANDANT, WAKUNDNR, WAWERK, WAABT, WAART, WAVAR, WAAENZL, WAAENB, WAAEND, WANEUB, WANEUD, WABEZ, WAMTART, WAMU, WARKZ, WAFKZ, WAMUART, WAMUNR, WAHERLD, WAFDDIM, WAMURLOD, WAMUPROD, WAMUCTOD, WAMUDTRL, WAMUBIRL, WAGASTA, WAMASTA, WAKESTA, WAROSTA, WARBSTA, WAFBSTA, WARPROF, WAFPROF, WARLSTA, WAFLSTA, WARSTAKZ, WAWAART, WARFERTKZ, WARKL, WARMEHRB, WARVOLL, WARAUFM, WATRAUFM, WATRLG, WARSTDLG, WARSTDGW, WARABLOM, WARMUNR, WARBEM, WATEXTE1, WATEXTE2, WATEXTE3, WATEXTE4, WAKRITI, WARGKZ1, WAGFKZ, WARAUFT, WARAUFD, WARUNGLFM, WARUNGQM, WARUNBRT, WARUNFDK, WARUNFDS, WARWBRT, WARBRLST, WARBRTOL, WARGRQM, WARGRLFD, WARGWTOL, WARARTDICKE, WARARTTOLP, WARARTTOLM, WARFDDIK, WARFDDIS, WABIND, WARIPP, WASCHLICHTGR, WASCHLICHTNR, WAEINZNR, WATSDSCH, WASTTEIL, WAFSTAKZ, WAFFERTKZ, WAAUSART, WASTUEART, WAVWART, WAVWVAR, WAVARFR, WAFMEHRB, WAFVOLL, WAFAUFM, WAFSTDLG, WAFSTDGW, WAFABLOM, WAGVORL, WAOVORL, WAFRBST, WALAMFR, WAFGKZ1, WAFGKZ2, WAFGKZ3, WASCHLKZ, WAFAUFT, WAFAUFD, WAFKART, WAKOLL, WAFBEM, WAFUNGLFM, WAFUNGQM, WAFUNBRT, WAFUNFDK, WAFUNFDS, WAFBRTU, WAFBRTUT, WAFBRTL, WAFBRTLT, WASCHNK, WALAEAEND, WARENDEM, WARENDEMNT, WAGWVERL, WAALKV, WAFGRQM, WAFGRLFD, WAFGWTOL, WAFARTDICKE, WAFARTTOLP, WAFARTTOLM, WAFFDDIK, WAFFDDIS, WAUNI, WACOLORKZ, WAUNIGA, WAGEWICHT2, WAFVERF1, WAFVERF2, WAFVERF3, WAFVERF4, WAFZUSTAND1, WAFZUSTAND2, WAFZUSTAND3, WAFZUSTAND4, WAFVERFN1, WAFVERFN2, WAFVERFN3, WAFVERFN4, WAFFGRPN1, WAFFGRPN2, WAFFGRPN3, WAFFGRPN4, WAVNRKZ, WAZUSTKZ, WAUEKLOKZ, WAFSUBST, WAMAXFA, WAAKZWG, WAFRESTF, WADRUCKBAR, WAVBRGQM, WALEDR, WADVERF1, WADVERF2, WADVERF3, WADVERF4, WADZUSTAND1, WADZUSTAND2, WADZUSTAND3, WADZUSTAND4, WADVERFN1, WADVERFN2, WADVERFN3, WADVERFN4, WADFGRPN1, WADFGRPN2, WADFGRPN3, WADFGRPN4, WADSUBST, WADRESTF, WAFAKTOR, WABSUBST, WAVORBWA, WANACHBWA, WAVORBFB, WANACHBFB, WAVORBDR, WANACHBDR, WAVORBAP, WANACHBAP, WAMVB, WAMNB, WACVB, WACNB, WABVB, WABNB, WASVB, WASNB, WASUBSTGR, WAHANDICAP, WAZUSCHAB, WALOSGRFB, WAQCCHECK, WADART, WADVAR, WADSTDKZ, WADSACHB, WASCHNKZ, WAPROGRP, WAARTGRP, WAWBZEIT, WAMINBST, WAMAXBST, WAOPTMGR, WAOPTMGF, WARMINPMENG, WAFMINPMENG, WAUEBM, WAUEBG, WAUEBF, WAMATPRF, WABRTPRF, WAGQMPRF, WASTKGP, WASCHLIP, WASCHLIA, WALPABR, WADISPZS, WADRPAR, WAZUSTR, WAWDSUM, WASTSKZ, WASTSART, WASTSAUF, WASTSLG, WASTSBRT, WASTSDKZ, WAFILLER1, WAVOLU, WAANAB, WAALBIS, WAPLGRP, WAPRODH, WAMATKL, WAPMGRP, WAPRFSCHL, WAKAART, WAKAVAR, WAKASTD, WAKAZGRP, WAKAPRGRPN1, WAKAPRGRPN2, WAKAPRGRPN3, WAKAAGRA, WAKAAGRP, WAZWTWAHL, WAVERL, WAABR, WAABRTOL, WAKABRT, WARKABRTOL, WAFKABRTOL, WAMATKTO, WAKTO1, WAGV, WAKBON, WAMGKMM, WAMEZ, WAWAG, WABKLAS, WABWPLAN, WAEKGRP, WABSTME, WAVABME, WAEKWSL, WALIEFNR, WAEG, WABON, WAKUNDE, WALOHNW, WALOHNA, WASCHLIAUF, WAPFCODE, WAAUFKZ, WAMRKM1, WAMRKM2, WAMRKM3, WAMRKM4, WAMRKM5, WAESACHB, WAESACHBKZ, WAFBGRLFM, WAPRUEFKZ, WAPRUEFBEN, WAPRUEFDAT, WARAVGRP, WATAX, WAPARTBA, WAFDDIF, WAFILLER2)"
                        + "VALUES (:WAMANDANT:, '00000000', '   ', '   ', :WAART:, :WAVAR:, 1, '        ', 0, :WANEUB:, :WANEUD:, '                                        ', '    ', ' ', 'J', 'J', '                    ', '                    ', '   ', 'INC', '00', '00', ' ', 0, '        ', 'V', 'V', 'V', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'A', 'GEW', 'E', '    ', ' ', 'P', '  ', '  ', 0, 200000, 25400, '          ', '               ', '                                        ', '          ', '          ', '          ', '          ', 'N', ' ', 'J', '        ', 0, ' ', ' ', ' ', ' ', ' ', 0, 0, 0, 0, 0, 0, '0000', '0000', '0000', 0, 0, '               ', 0, '     ', '000000000000000', '               ', 0, 'J', 'A', 'E', 'FI  ', '   ', '                    ', '  ', 'J', ' ', 'P', '  ', 0, 0, '          ', '          ', '          ', 'C ', 'N', ' ', ' ', ' ', ' ', '        ', 0, '          ', '     ', '                                        ', ' ', ' ', ' ', ' ', ' ', 0, 0, 0, 0, 0,0, 0, 0, 0, '00', 0, 0, 0, '0000', '0000', '0000', 0, 0, ' ', ' ', ' ', 0, '   ', '   ', '   ', '   ', '    ', '    ', '    ', '    ', '   ', '   ', '   ', '   ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '               ', 0, 0, 0, ' ', 0, 0, '   ', '   ', '   ', '   ', '    ', '    ', '    ', '    ', '   ', '   ', '   ', '   ', ' ', ' ', ' ', ' ', '               ', 0, 0, '               ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', '   ', 0, 0, ' ', '                    ', '  ', 'J', '        ', ' ', '   ', '   ', '00', 0, 0, 5000, 5000, 0, 0, 'MTR', '2', '000001000000', ' ', ' ', ' ', ' ', ' ', ' ', 'N', 'N', '     ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '         ', 0, 0, 0, '  ', '                  ', '         ', '    ', '         ', '                    ', '  ', 'J', 'GGG', ' ', ' ', ' ', '     ', '  ', 80, 50, 0, '0', 0, 0, 0, '      ', '      ', '      ', 0, '        ', 0, 0, '    ', ' ', '   ', '   ', ' ', '    ', '        ', 'N', 'N', '        ', '                    ', '                    ', 0, '     ', ' ', '    ', '    ', '    ', '    ', '    ', '        ', 'B', 0, 'N', '        ', 0, '10  ', 'RMB', ' ', 25400, '                                                      ')";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
            }
            Connect2Proxy(or1);
        }
        public override string BATCHINSERT(DataRow dwData)
        {
            dwData["WANEUB"] = app.User;
            dwData["WANEUD"] = date;
            string value = "";
            switch (app.company)
            {
                default:
                case "SXN":
                case "YGR":
                case "TST":
                    value = "INTO WASTAMM  "
                      + "VALUES(:WAMANDANT:,:WAKUNDNR:,:WAWERK:,:WAABT:,:WAART:,:WAVAR:,:WAAENZL:,:WAAENB:,:WAAEND:,:WANEUB:,:WANEUD:,:WABEZ:,:WAMTART:,:WAMU:,:WARKZ:,:WAFKZ:,:WAMUART:,:WAMUNR:,:WAHERLD:,:WAFDDIM:,:WAMURLOD:,:WAMUPROD:,:WAMUCTOD:,:WAMUDTRL:,:WAMUBIRL:,:WAGASTA:,:WAMASTA:,:WAKESTA:,:WAROSTA:,:WARBSTA:,:WAFBSTA:,:WARPROF:,:WAFPROF:,:WARLSTA:,:WAFLSTA:,:WARSTAKZ:,:WAWAART:,:WARFERTKZ:,:WARKL:,:WARMEHRB:,:WARVOLL:,:WARAUFM:,:WATRAUFM:,:WATRLG:,:WARSTDLG:,:WARSTDGW:,:WARABLOM:,:WARMUNR:,:WARBEM:,:WATEXT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PN1:,:WAKAPRGRPN2:,:WAKAPRGRPN3:,:WAKAAGRA:,:WAKAAGRP:,:WAZWTWAHL:,:WAVERL:,:WAABR:,:WAABRTOL:,:WAKABRT:,:WARKABRTOL:,:WAFKABRTOL:,:WAMATKTO:,:WAKTO1:,:WAGV:,:WAKBON:,:WAMGKMM:,:WAMEZ:,:WAWAG:,:WABKLAS:,:WABWPLAN:,:WAEKGRP:,:WABSTME:,:WAVABME:,:WAEKWSL:,:WALIEFNR:,:WAEG:,:WABON:,:WAKUNDE:,:WALOHNW:,:WALOHNA:,:WASCHLIAUF:,:WAPFCODE:,:WAAUFKZ:,:WAMRKM1:,:WAMRKM2:,:WAMRKM3:,:WAMRKM4:,:WAMRKM5:,:WAESACHB:,:WAESACHBKZ:,:WAFBGRLFM:,:WAPRUEFKZ:,:WAPRUEFBEN:,:WAPRUEFDAT:,:WARAVGRP:,:WATAX:,:WAPARTBA:,:WAFDDIF:,:WAINSPCOR:,:WAINSPGRP:,:WAKENNFD:,:WAFILLER2:)";
                    value = INTEXDBC.InjectData(value, dwData);
                    break;
            }
            return value;
        }
        public void DeleteWASTAMM(string client, string art, string var)
        {
           
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "DELETE WASTAMM WHERE  WAMANDANT=:WAMANDANT AND WAART=:WAART AND WAVAR=:WAVAR";
            or1.Parameters.Add("WAMANDANT", OracleType.NVarChar).Value = client;
            or1.Parameters.Add("WAART", OracleType.NVarChar).Value = art;
            or1.Parameters.Add("WAVAR", OracleType.NVarChar).Value = var;
            Connect2Proxy(or1);
        }
        public void DeleteWASTAMM(DataRow dwData, int option = 1)
        {

            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM WASTAMM   WHERE  WAMANDANT=:WAMANDANT: AND WAART=:WAART: AND WAVAR=:WAVAR:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }
        public void DWS00(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();

            or1.CommandText = "DELETE FROM WASTAMM   WHERE  WAMANDANT=:WAMANDANT: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

            Connect2Proxy(or1);
        }
        public void DWS010(DataRow dwData)
        {

            or1 = OracleDB.CreateCommand();

            or1.CommandText = "DELETE FROM WASTAMM   WHERE  WAMANDANT=:WAMANDANT: " +dwData["WAART"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

            Connect2Proxy(or1);
        }
        public DataSet QWS00(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTAMM WHERE  ROWNUM<2 ";
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS_99(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT 1 FROM WASTAMM WHERE WAMANDANT=:WAMANDANT: AND WAART=:WAART: AND WAVAR=:WAVAR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS01(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTAMM WHERE  WAMANDANT=:WAMANDANT: AND WAART=:WAART: AND WAVAR=:WAVAR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS03(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTAMM WHERE   WAMANDANT=:WAMANDANT: AND WAART=:WAART:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS31(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WAART AS FSART FROM WASTAMM WHERE   WAMANDANT=:WAMANDANT: AND WAART=:WAART:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT WF.* FROM WDECK WD RIGHT JOIN WASTAMM WF ON  WAMANDANT=WDMANDANT AND WAART=WDART AND WAVAR=WDVAR "
                       + " WHERE WAKUNDNR='        ' AND WDMANDANT=:WDMANDANT: AND WDSA='K' AND WDTYP='B' AND WDWAKZ='F' AND WDAUFKRS=:WDAUFKRS:  AND WDAUFLFD=:WDAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS05(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT WD.WDAUFKRS,WDAUFLFD,WDAUFPOS,WDSA,WDUPOS,W.* FROM WDECK  WD "
                        + " JOIN WASTAMM W ON WDART=W.WAART AND WDVAR=W.WAVAR "
                        + " WHERE WDMANDANT=:WDMANDANT: AND WDSA='K' AND WDTYP='B' AND WDWAKZ='F' AND WDAUFKRS=:WDAUFKRS:  AND WDAUFLFD=:WDAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS06(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WAART,WABEZ,WAFBRTU,WAFBRTL,WAFGRQM,WAFGRLFD FROM WASTAMM WHERE    WAMANDANT=:WAMANDANT: AND (WAFBRTU=0 OR WAFBRTL=0 OR  WAFGRQM=0 OR WAFGRLFD=0 )";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS07(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT * FROM WASTAMM WHERE   WAMANDANT=:WAMANDANT: AND WAART LIKE '" + dwData["WAART"].ToString() + "%'";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS08(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT M.* FROM WASTAMM M JOIN ABPOS ON ABPMANDANT=WAMANDANT AND ABPART=WAART   "
               + " WHERE  ABPMANDANT=:ABPMANDANT: AND ABPAUFKRS=:ABPAUFKRS: AND ABPAUFLFD=:ABPAUFLFD:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS09(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT M.* FROM WASTAMM M "
            + " WHERE WAMANDANT=:WAMANDANT: AND WAFKZ=:WAFKZ: AND WAART =:WAART: AND WAVAR=:WAVAR:"
            + " ORDER BY WAART,WAVAR";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWSDART(DataRow dwData)
        {  
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT DISTINCT M.* FROM WASTAMM M "
            + " WHERE WAMANDANT=:WAMANDANT: AND WADART =:WADART: AND WADVAR=:WADVAR:"
            + " ORDER BY WAART,WAVAR";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS10(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT M.* FROM WASTAMM M "
            + " WHERE  WAMANDANT=:WAMANDANT: AND WAART LIKE '%" + dwData["WAART"].ToString() + "%' AND WABEZ LIKE '%" + dwData["WABEZ"].ToString() + "%'";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS11(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WALIEFNR,LSLIEFNR,LSLIEFNA,WABIND FROM WASTAMM JOIN LIEFDAT ON WALIEFNR=LSLIEFNR WHERE  WAMANDANT=:WAMANDANT: AND WAART=:WAART: AND WAVAR=:WAVAR:";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS12(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WAMANDANT,WAART,WAFBRTL*0.1 AS WAFBRTL,WAFBRTU*0.1 AS WAFBRTU,WAFGRLFD,WAFGRQM FROM WASTAMM WHERE WAMANDANT=:WAMANDANT: AND WAART=:WAART: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS13(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT WAMANDANT,WAART,WAFBRTL*0.1 AS WAFBRTL,WAFBRTU*0.1 AS WAFBRTU,WAFGRLFD,WAFGRQM,STUELISASB,SUBSTR(STUELIDATEN,0,4),A.* FROM WASTAMM A "
                + " LEFT JOIN STUELI ON TRIM(SUBSTR(STUELISAPD,14,20))=TRIM(WAART) "
            + " WHERE WAMANDANT=:WAMANDANT: AND WAART=:WAART: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWS_1(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT RTRIM(WAART) AS KEY, WAART,WAVAR, WABEZ,WAFBRTU,WAFBRTL,WAFGRQM,WAFGRLFD,WARGRLFD,WARGRQM,WAFFDDIK,WAFFDDIS,WALIEFNR FROM WASTAMM WHERE  "
               + "  WAMANDANT=:WAMANDANT:"
               + " AND  WAART LIKE '" + dwData["WAART"].ToString().Trim() + "%'"
               + " ORDER BY WAART";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWSDESS(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT RTRIM(WAART) AS KEY, WAART,WAVAR, WABEZ,WAFBRTU,WAFBRTL,WAFGRQM,WAFGRLFD,WARGRLFD,WARGRQM,WAFFDDIK,WAFFDDIS,WALIEFNR FROM WASTAMM WHERE  "
               + "  WAMANDANT=:WAMANDANT:"
               + " AND  WAART LIKE '" + dwData["WAART"].ToString().Trim() + "%'"
               + " ORDER BY WAART";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QWSBYWS04(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT A.* FROM WASTAMM A "
                + "  JOIN STUELI ON  SUBSTR(STUELISAPD,15,20)=WAART  "
            + " WHERE WAMANDANT=:WAMANDANT:  "
            + dwData["WALIEFNR"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QueryWASTAMM(DataRow dwData, int option = 1)
        {
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0: SResult = QWS00(dwData); break;
                case -99: SResult = QWS_99(dwData); break;
                case 1:
                case 2: SResult = QWS01(dwData); break;
                case 3: SResult = QWS03(dwData); break;
                case 31: SResult = QWS31(dwData); break;
                case 4: SResult = QWS04(dwData); break;
                case 5: SResult = QWS05(dwData); break;
                case 6: SResult = QWS06(dwData); break;
                case 7: SResult = QWS07(dwData); break;
                case 8: SResult = QWS08(dwData); break;
                case 9: SResult = QWS09(dwData); break;
                case 10: SResult = QWS10(dwData); break;
                case 11: SResult = QWS11(dwData); break;
                case 12: SResult = QWS12(dwData); break;
                case 13: SResult = QWS13(dwData); break;
                case -1: SResult = QWS_1(dwData); break;
            }
            return SResult;
        }
        public void UpdateWASTAMM(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            if (option == 0)
            {
                switch (app.company)
                {
                    case "YGR":
                    case "AFS":
                    case "TST":
                    case "UBT":
                    case "SXN":
                    default:
                        UWS02(dwData);
                        break;
                    case "JLT":
                    case "DST":
                        UWS01(dwData);
                        break;
                }
            }

        }
        public void UWS01(DataRow dwData)
        {
            dwData["WAAENB"] = app.User;
            dwData["WAAEND"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WASTAMM SET WABEZ=:WABEZ,WARBEM=:WARBEM,WAAENB=:WAAENB,WAAEND=:WAAEND,WARABLOM=:WARABLOM,WAFGWTOL=:WAFGWTOL,WAALKV=:WAALKV,WAVWART=:WAVWART,WAVWVAR=:WAVWVAR,WAKAART=:WAKAART,WAKAVAR=:WAKAVAR,WADART=:WADART,WADVAR=:WADVAR,WASUBSTGR=:WASUBSTGR,WAPROGRP=:WAPROGRP,WAARTGRP=:WAARTGRP,WAFDDIM=:WAFDDIM"
    + ",WAFFERTKZ=:WAFFERTKZ,WARFERTKZ=:WARFERTKZ,WAGFKZ=:WAGFKZ,WAFRBST=:WAFRBST,WAMASTA=:WAMASTA,WAKESTA=:WAKESTA,WAMATPRF=:WAMATPRF,WABRTPRF=:WABRTPRF,WASTKGP=:WASTKGP,WASCHLIP=:WASCHLIP,WASCHLIA=:WASCHLIA,WALIEFNR=:WALIEFNR,WAEG=:WAEG"
    + ",WARSTDLG=:WARSTDLG,WARSTDGW=:WARSTDGW,WAFSTDLG=:WAFSTDLG,WAFSTDGW=:WAFSTDGW,WARSTAKZ=:WARSTAKZ,WAGASTA=:WAGASTA,WAUEBM=:WAUEBM,WARWBRT= :WARWBRT,WAFBRTL=:WAFBRTL,WAFBRTU=:WAFBRTU,WARGRQM=:WARGRQM, WAFGRQM=:WAFGRQM, WARGRLFD=:WARGRLFD, WAFGRLFD=:WAFGRLFD, WARGWTOL=:WARGWTOL"
    + ",WARFDDIK=:WARFDDIK, WARFDDIS=:WARFDDIS, WAFFDDIK=:WAFFDDIK,WAFFDDIS=:WAFFDDIS,WABIND=:WABIND, WAEINZNR=:WAEINZNR, WATSDSCH=:WATSDSCH, WALAEAEND=:WALAEAEND"
   + " WHERE    WAMANDANT=:WAMANDANT AND WAART=:WAART AND WAVAR=:WAVAR";

            or1.Parameters.Add("WAMANDANT", OracleType.NVarChar).Value = dwData["WAMANDANT"].ToString();
            or1.Parameters.Add("WAART", OracleType.NVarChar).Value = dwData["WAART"].ToString();
            or1.Parameters.Add("WAVAR", OracleType.NVarChar).Value = dwData["WAVAR"].ToString();
            or1.Parameters.Add("WABEZ", OracleType.NVarChar).Value = dwData["WABEZ"].ToString();
            or1.Parameters.Add("WARBEM", OracleType.NVarChar).Value = dwData["WARBEM"].ToString();
            or1.Parameters.Add("WAAENB", OracleType.NVarChar).Value = dwData["WAAENB"].ToString();
            or1.Parameters.Add("WAAEND", OracleType.DateTime).Value = dwData["WAAEND"].ToString();
            or1.Parameters.Add("WARABLOM", OracleType.DateTime).Value = dwData["WARABLOM"].ToString();
            or1.Parameters.Add("WARSTAKZ", OracleType.DateTime).Value = dwData["WARSTAKZ"].ToString();
            or1.Parameters.Add("WAGASTA", OracleType.DateTime).Value = dwData["WAGASTA"].ToString();
            or1.Parameters.Add("WAUEBM", OracleType.DateTime).Value = dwData["WAUEBM"].ToString();

            or1.Parameters.Add("WAVWART", OracleType.NVarChar).Value = dwData["WAVWART"].ToString();
            or1.Parameters.Add("WAVWVAR", OracleType.NVarChar).Value = dwData["WAVWVAR"].ToString();
            or1.Parameters.Add("WAKAART", OracleType.NVarChar).Value = dwData["WAKAART"].ToString();
            or1.Parameters.Add("WAKAVAR", OracleType.NVarChar).Value = dwData["WAKAVAR"].ToString();
            or1.Parameters.Add("WADART", OracleType.NVarChar).Value = dwData["WADART"].ToString();
            or1.Parameters.Add("WADVAR", OracleType.NVarChar).Value = dwData["WADVAR"].ToString();

            or1.Parameters.Add("WASUBSTGR", OracleType.NVarChar).Value = dwData["WASUBSTGR"].ToString();
            or1.Parameters.Add("WAPROGRP", OracleType.NVarChar).Value = dwData["WAPROGRP"].ToString();
            or1.Parameters.Add("WAARTGRP", OracleType.NVarChar).Value = dwData["WAARTGRP"].ToString();
            or1.Parameters.Add("WAFFERTKZ", OracleType.NVarChar).Value = dwData["WAFFERTKZ"].ToString();
            or1.Parameters.Add("WARFERTKZ", OracleType.NVarChar).Value = dwData["WARFERTKZ"].ToString();
            or1.Parameters.Add("WAGFKZ", OracleType.NVarChar).Value = dwData["WAGFKZ"].ToString();
            or1.Parameters.Add("WAFRBST", OracleType.NVarChar).Value = dwData["WAFRBST"].ToString();

            or1.Parameters.Add("WAMASTA", OracleType.NVarChar).Value = dwData["WAMASTA"].ToString();
            or1.Parameters.Add("WAKESTA", OracleType.NVarChar).Value = dwData["WAKESTA"].ToString();
            or1.Parameters.Add("WAMATPRF", OracleType.NVarChar).Value = dwData["WAMATPRF"].ToString();
            or1.Parameters.Add("WABRTPRF", OracleType.NVarChar).Value = dwData["WABRTPRF"].ToString();
            or1.Parameters.Add("WASTKGP", OracleType.NVarChar).Value = dwData["WASTKGP"].ToString();
            or1.Parameters.Add("WASCHLIP", OracleType.NVarChar).Value = dwData["WASCHLIP"].ToString();
            or1.Parameters.Add("WASCHLIA", OracleType.NVarChar).Value = dwData["WASCHLIA"].ToString();
            or1.Parameters.Add("WALIEFNR", OracleType.NVarChar).Value = dwData["WALIEFNR"].ToString();
            or1.Parameters.Add("WAEG", OracleType.NVarChar).Value = dwData["WAEG"].ToString();

            or1.Parameters.Add("WAFDDIM", OracleType.NVarChar).Value = dwData["WAFDDIM"].ToString();

            or1.Parameters.Add("WARSTDLG", OracleType.Number).Value = dwData["WARSTDLG"].ToString();
            or1.Parameters.Add("WARSTDGW", OracleType.Number).Value = dwData["WARSTDGW"].ToString();
            or1.Parameters.Add("WAFSTDLG", OracleType.Number).Value = dwData["WAFSTDLG"].ToString();
            or1.Parameters.Add("WAFSTDGW", OracleType.Number).Value = dwData["WAFSTDGW"].ToString();
            or1.Parameters.Add("WAALKV", OracleType.Number).Value = dwData["WAALKV"].ToString();

            or1.Parameters.Add("WARWBRT", OracleType.Number).Value = dwData["WARWBRT"].ToString();
            or1.Parameters.Add("WAFBRTL", OracleType.Number).Value = dwData["WAFBRTL"].ToString();
            or1.Parameters.Add("WAFBRTU", OracleType.DateTime).Value = dwData["WAFBRTU"].ToString();
            or1.Parameters.Add("WARGRQM", OracleType.Number).Value = dwData["WARGRQM"].ToString();
            or1.Parameters.Add("WAFGRQM", OracleType.Number).Value = dwData["WAFGRQM"].ToString();
            or1.Parameters.Add("WARGRLFD", OracleType.Number).Value = dwData["WARGRLFD"].ToString();
            or1.Parameters.Add("WAFGRLFD", OracleType.Number).Value = dwData["WAFGRLFD"].ToString();
            or1.Parameters.Add("WARGWTOL", OracleType.Number).Value = dwData["WARGWTOL"].ToString();
            or1.Parameters.Add("WAFGWTOL", OracleType.Number).Value = dwData["WAFGWTOL"].ToString();

            or1.Parameters.Add("WARFDDIK", OracleType.Number).Value = dwData["WARFDDIK"].ToString();
            or1.Parameters.Add("WARFDDIS", OracleType.Number).Value = dwData["WARFDDIS"].ToString();
            or1.Parameters.Add("WAFFDDIK", OracleType.Number).Value = dwData["WAFFDDIK"].ToString();
            or1.Parameters.Add("WAFFDDIS", OracleType.Number).Value = dwData["WAFFDDIS"].ToString();
            or1.Parameters.Add("WABIND", OracleType.NVarChar).Value = dwData["WABIND"].ToString();
            or1.Parameters.Add("WAEINZNR", OracleType.NVarChar).Value = dwData["WAEINZNR"].ToString();
            or1.Parameters.Add("WATSDSCH", OracleType.NVarChar).Value = dwData["WATSDSCH"].ToString();
            or1.Parameters.Add("WALAEAEND", OracleType.NVarChar).Value = dwData["WALAEAEND"].ToString();
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UWS02(DataRow dwData)
        {
            dwData["WAAENB"] = app.User;
            dwData["WAAEND"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WASTAMM SET WAMANDANT=:WAMANDANT:,WAKUNDNR=:WAKUNDNR:,WAWERK=:WAWERK:,WAABT=:WAABT:,WAART=:WAART:,WAVAR=:WAVAR:,WAAENZL=WAAENZL+1,WAAENB=:WAAENB:,WAAEND=:WAAEND:,WANEUB=:WANEUB:,WANEUD=:WANEUD:,WABEZ=:WABEZ:,WAMTART=:WAMTART:,WAMU=:WAMU:,WARKZ=:WARKZ:,WAFKZ=:WAFKZ:,WAMUART=:WAMUART:,WAMUNR=:WAMUNR:,WAHERLD=:WAHERLD:,WAFDDIM=:WAFDDIM:,WAMURLOD=:WAMURLOD:,WAMUPROD=:WAMUPROD:,WAMUCTOD=:WAMUCTOD:,WAMUDTRL=:WAMUDTRL:,WAMUBIRL=:WAMUBIRL:,WAGASTA=:WAGASTA:,WAMASTA=:WAMASTA:,WAKESTA=:WAKESTA:,WAROSTA=:WAROSTA:,WARBSTA=:WARBSTA:,WAFBSTA=:WAFBSTA:,WARPROF=:WARPROF:,WAFPROF=:WAFPROF:,WARLSTA=:WARLSTA:,WAFLSTA=:WAFLSTA:,WARSTAKZ=:WARSTAKZ:,WAWAART=:WAWAART:,WARFERTKZ=:WARFERTKZ:,WARKL=:WARKL:,WARMEHRB=:WARMEHRB:,WARVOLL=:WARVOLL:,WARAUFM=:WARAUFM:,WATRAUFM=:WATRAUFM:,WATRLG=:WATRLG:,WARSTDLG=:WARSTDLG:,WARSTDGW=:WARSTDGW:,WARABLOM=:WARABLOM:,WARMUNR=:WARMUNR:,WARBEM=:WARBEM:,WATEXTE1=:WATEXTE1:,WATEXTE2=:WATEXTE2:,WATEXTE3=:WATEXTE3:,WATEXTE4=:WATEXTE4:,WAKRITI=:WAKRITI:,WARGKZ1=:WARGKZ1:,WAGFKZ=:WAGFKZ:,WARAUFT=:WARAUFT:,WARAUFD=:WARAUFD:,WARUNGLFM=:WARUNGLFM:,WARUNGQM=:WARUNGQM:,WARUNBRT=:WARUNBRT:,WARUNFDK=:WARUNFDK:,WARUNFDS=:WARUNFDS:,WARWBRT=:WARWBRT:,WARBRLST=:WARBRLST:,WARBRTOL=:WARBRTOL:,WARGRQM=:WARGRQM:,WARGRLFD=:WARGRLFD:,WARGWTOL=:WARGWTOL:,WARARTDICKE=:WARARTDICKE:,WARARTTOLP=:WARARTTOLP:,WARARTTOLM=:WARARTTOLM:,WARFDDIK=:WARFDDIK:,WARFDDIS=:WARFDDIS:,WABIND=:WABIND:,WARIPP=:WARIPP:,WASCHLICHTGR=:WASCHLICHTGR:,WASCHLICHTNR=:WASCHLICHTNR:,WAEINZNR=:WAEINZNR:,WATSDSCH=:WATSDSCH:,WASTTEIL=:WASTTEIL:,WAFSTAKZ=:WAFSTAKZ:,WAFFERTKZ=:WAFFERTKZ:,WAAUSART=:WAAUSART:,WASTUEART=:WASTUEART:,WAVWART=:WAVWART:,WAVWVAR=:WAVWVAR:,WAVARFR=:WAVARFR:,WAFMEHRB=:WAFMEHRB:,WAFVOLL=:WAFVOLL:,WAFAUFM=:WAFAUFM:,WAFSTDLG=:WAFSTDLG:,WAFSTDGW=:WAFSTDGW:,WAFABLOM=:WAFAB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RPN2=:WAFFGRPN2:,WAFFGRPN3=:WAFFGRPN3:,WAFFGRPN4=:WAFFGRPN4:,WAVNRKZ=:WAVNRKZ:,WAZUSTKZ=:WAZUSTKZ:,WAUEKLOKZ=:WAUEKLOKZ:,WAFSUBST=:WAFSUBST:,WAMAXFA=:WAMAXFA:,WAAKZWG=:WAAKZWG:,WAFRESTF=:WAFRESTF:,WADRUCKBAR=:WADRUCKBAR:,WAVBRGQM=:WAVBRGQM:,WALEDR=:WALEDR:,WADVERF1=:WADVERF1:,WADVERF2=:WADVERF2:,WADVERF3=:WADVERF3:,WADVERF4=:WADVERF4:,WADZUSTAND1=:WADZUSTAND1:,WADZUSTAND2=:WADZUSTAND2:,WADZUSTAND3=:WADZUSTAND3:,WADZUSTAND4=:WADZUSTAND4:,WADVERFN1=:WADVERFN1:,WADVERFN2=:WADVERFN2:,WADVERFN3=:WADVERFN3:,WADVERFN4=:WADVERFN4:,WADFGRPN1=:WADFGRPN1:,WADFGRPN2=:WADFGRPN2:,WADFGRPN3=:WADFGRPN3:,WADFGRPN4=:WADFGRPN4:,WADSUBST=:WADSUBST:,WADRESTF=:WADRESTF:,WAFAKTOR=:WAFAKTOR:,WABSUBST=:WABSUBST:,WAVORBWA=:WAVORBWA:,WANACHBWA=:WANACHBWA:,WAVORBFB=:WAVORBFB:,WANACHBFB=:WANACHBFB:,WAVORBDR=:WAVORBDR:,WANACHBDR=:WANACHBDR:,WAVORBAP=:WAVORBAP:,WANACHBAP=:WANACHBAP:,WAMVB=:WAMVB:,WAMNB=:WAMNB:,WACVB=:WACVB:,WACNB=:WACNB:,WABVB=:WABVB:,WABNB=:WABNB:,WASVB=:WASVB:,WASNB=:WASNB:,WASUBSTGR=:WASUBSTGR:,WAHANDICAP=:WAHANDICAP:,WAZUSCHAB=:WAZUSCHAB:,WALOSGRFB=:WALOSGRFB:,WAQCCHECK=:WAQCCHECK:,WADART=:WADART:,WADVAR=:WADVAR:,WADSTDKZ=:WADSTDKZ:,WADSACHB=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AKABRT:,WARKABRTOL=:WARKABRTOL:,WAFKABRTOL=:WAFKABRTOL:,WAMATKTO=:WAMATKTO:,WAKTO1=:WAKTO1:,WAGV=:WAGV:,WAKBON=:WAKBON:,WAMGKMM=:WAMGKMM:,WAMEZ=:WAMEZ:,WAWAG=:WAWAG:,WABKLAS=:WABKLAS:,WABWPLAN=:WABWPLAN:,WAEKGRP=:WAEKGRP:,WABSTME=:WABSTME:,WAVABME=:WAVABME:,WAEKWSL=:WAEKWSL:,WALIEFNR=:WALIEFNR:,WAEG=:WAEG:,WABON=:WABON:,WAKUNDE=:WAKUNDE:,WALOHNW=:WALOHNW:,WALOHNA=:WALOHNA:,WASCHLIAUF=:WASCHLIAUF:,WAPFCODE=:WAPFCODE:,WAAUFKZ=:WAAUFKZ:,WAMRKM1=:WAMRKM1:,WAMRKM2=:WAMRKM2:,WAMRKM3=:WAMRKM3:,WAMRKM4=:WAMRKM4:,WAMRKM5=:WAMRKM5:,WAESACHB=:WAESACHB:,WAESACHBKZ=:WAESACHBKZ:,WAFBGRLFM=:WAFBGRLFM:,WAPRUEFKZ=:WAPRUEFKZ:,WAPRUEFBEN=:WAPRUEFBEN:,WAPRUEFDAT=:WAPRUEFDAT:,WARAVGRP=:WARAVGRP:,WATAX=:WATAX:,WAPARTBA=:WAPARTBA:,WAFDDIF=:WAFDDIF:,WAINSPCOR=:WAINSPCOR:,WAINSPGRP=:WAINSPGRP:,WAKENNFD=:WAKENNFD:,WAFILLER2=:WAFILLER2:"
                    + " WHERE WAMANDANT=:WAMANDANT: AND WAART=:WAART: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }
        public void UWAGFKZ(DataRow dwData)
        {
            dwData["WAAENB"] = app.User;
            dwData["WAAEND"] = date;
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "UPDATE WASTAMM SET WAGFKZ=:WAGFKZ:"
                    + " WHERE WAMANDANT=:WAMANDANT: AND WAART=:WAART: ";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            Connect2Proxy(or1);
        }        
    }
}
